<template>
  <div class="app-container">
    <h1>App 根组件</h1>
    <hr />

    <Article>
      <template #title>
        <h3>一首诗</h3>
      </template>
      <template #content="{ msg, user }">
        <p>啊，大海，全是水。</p>
        <p>啊，蜈蚣，全是腿。</p>
        <p>啊，辣椒，进辣嘴。</p>
        <p>{{ msg }}</p>
        <p>{{ user.name }}</p>
      </template>
      <template #author>
        <div>作者：zwt</div>
      </template>
    </Article>
    <hr />

    <div class="box" style="display: none;">
      <!-- 渲染 Left 组件和 Right 组件 -->
      <Left>
        <!-- 默认情况下，自动插入名为default的插槽上 -->
        <!-- v-slot: 简写形式是 # -->
        <template #default>
          <p>这是 Left 组件的内容区</p>
        </template>
      </Left>
    </div>
  </div>
</template>

<script>
import Left from './components/Left.vue'
import Article from './components/Article.vue'

export default {
  components: {
    Left,
    Article
  }
}
</script>

<style lang="less">
.app-container {
  padding: 1px 20px 20px;
  background-color: #efefef;
}
.box {
  display: flex;
}
</style>
